/*
    This file is part of the AmaurotMS MapleStory Server, commands OdinMS-based
    Copyleft (L) 2016 - 2019 RonanLana

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation version 3 as published by
    the Free Software Foundation. You may not use, modify or distribute
    this program under any other version of the GNU Affero General Public
    License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
   @Author: MizukiandEna - Refactored command content into modules
*/
package org.gms.client.command.commands.gm0;

import org.gms.client.Character;
import org.gms.client.Client;
import org.gms.client.command.Command;

public class CheckStyleCommand extends Command {
    {
        setDescription("检查您现在处于独行姿态、剑姿态还是盾姿态。 ");
    }
    @Override
    public void execute(Client c, String[] params) {
        Character player = c.getPlayer();
        String answer = player.getAbstractPlayerInteraction().getCharacterExtendValue("剑盾姿态");
        if(answer != null) {
            if(answer.equals("solo")){
                player.yellowMessage("独行姿态Solo。您现在是独立作战。");
            }else{
                int answerInt = Integer.parseInt(player.getAbstractPlayerInteraction().getCharacterExtendValue("剑盾数值"));
                if(answer.equals("shield")){
                    player.yellowMessage("您目前处于权重为"+answerInt+"的盾姿态Shield");
                }else{
                    player.yellowMessage("剑姿态Sword已开启。您现在开始依靠自己的队友。您受的伤为原先的"+answerInt+"%，您的盾姿态队友将分摊您原本承受的"+(200-2*answerInt)+"%伤害");
                }
            }
        }else{
            player.yellowMessage("您还没有进入过姿态");
        }
        player.getAbstractPlayerInteraction().saveOrUpdateCharacterExtendValue("剑盾数值","0");

    }
}